#ifndef __STK_ITEM_H__
#define __STK_ITEM_H__

#include "IUtility.h"
#include "IPacket.h"
#include "IOptionsControl.h"

class CStkItem: public virtual IStkItem, public virtual IProductInstance
{
INIT_CLASS_PRODUCT(CStkItem)
public:
	const bool Init(const void * pvdPara, char * pszMsgTxt, int iMsgTxtSize);
	const bool AddJson(IPacket * ptrResult);
	IContract * GetContractByOptCode(const char * pszOptCode);
	void SetContractByOptCode(const char * pszOptCode, IContract * ptrContract);
	IContract * GetContractByOptNum(const char * pszOptNum);
	void SetContractByOptNum(const char * pszOptNum, IContract * ptrContract);
	bool GetContractInfo(void * vtContractInfo, int iType = 0); //vector<string>
	bool GetHQ_STATUS(string & strValue);
	void SetHQ_STATUS(const string & strValue);
	string GetKey(string & strValue);
	void SetKey(const string & strKey);
	unsigned int GetContractCount();
	bool GetWarningFlg();
	void SetWarningFlg(const bool bValue);
	bool GetErrorFlg();
	void SetErrorFlg(const bool bValue);
	string OPT_UNDL_CODE(string & strValue);

	bool GetStopBusinessFlg();
	bool GetMsg(string & strValue);
	bool GetFormMsg(const char * pszName, string & strValue);
	void * GetWindowsPosInfo();
	void SetWindowsPosInfo(void * ptrVal);
	bool GetNormList(const char * pszName, void * ptrList);
	bool SetNormList(const char * pszName, void * ptrList);

private:
	IContract * GetContract(IValueSet * pszList, const char * pszCode);
	void SetContract(IValueSet * pszList, const char * pszCode, IContract * ptrContract);

private:
	ITaskQueue * m_ptrCalculateQueue;
	IValueSet * m_ptrContractsByCode, * m_ptrContractsByNum;
	vector<string> m_vtIndexList;
};



#endif // !__STK_ITEM_H__
